/// <license>
/// Copyright (c) 2002-2008, DotNetNuke Corporation
/// All rights reserved
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
/// documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
/// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
/// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in all copies or substantial portions 
/// of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
/// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
/// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
/// DEALINGS IN THE SOFTWARE.
/// </license>

using System;
using System.Collections.Generic;
using System.Text;
using DotNetNuke.Common.Utilities;

namespace DotNetNuke.Modules.Articles.Framework
{
    /// -----------------------------------------------------------------------------
    /// Namespace:  DotNetNuke.Modules.Articles.Framework
    /// Project:    Articles Private Assembly
    /// Module:     SectionEventArgs
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The SectionEventArgs Class provides a customised EventArgs object, for Section
    /// based Events
    /// </summary>
    /// <history>
    /// 	[cnurse]	02/01/2006	created
    /// </history>
    /// -----------------------------------------------------------------------------
    public class SectionEventArgs : EventArgs
    {

        #region Private Members

        private SectionInfo _Section;
        private int _SectionId = Null.NullInteger;

        #endregion

        #region Constructors

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructor builds a default SectionEventArgs object
        /// </summary>
        /// <history>
        /// 	[cnurse]	02/01/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public SectionEventArgs() 
        {
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructor builds an SectionEventArgs object with a Section Id
        /// </summary>
        /// <remarks>
        /// </remarks>
        ///	<param name="sectionId">The Id of the Section</param>
        /// <history>
        /// 	[cnurse]	02/01/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public SectionEventArgs(int sectionId)
        {
            _SectionId = sectionId;
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructor builds an SectionEventArgs object with a Section
        /// </summary>
        /// <remarks>
        /// </remarks>
        ///	<param name="section">The Section</param>
        /// <history>
        /// 	[cnurse]	04/17/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public SectionEventArgs(SectionInfo section)
        {
            _Section = section;
            _SectionId = section.SectionId;
        }

        #endregion

        #region Public Properties

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets and sets the Section.
        /// </summary>
        /// <history>
        /// 	[cnurse]	04/17/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public SectionInfo Section
        {
            get { return _Section; }
            set { _Section = value; }
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Gets the Id of the Section.
        /// </summary>
        /// <history>
        /// 	[cnurse]	02/01/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        public int SectionId
        {
            get { return (_SectionId == Null.NullInteger && Section != null) ? Section.SectionId : _SectionId; }
            set { _SectionId = value; }
        }

        #endregion

    }
}
